package com.luhuiguo.cms.shared.model;

import java.io.Serializable;
import java.util.Date;

import com.extjs.gxt.ui.client.data.BeanModelTag;

public class UserModel implements BeanModelTag, Serializable {

    private static final long serialVersionUID = 9030107610408583601L;

    private Long id;

    private String username;

    private String password;

    private String fullName;

    private String email;

    private boolean enabled;

    private Role role = Role.ROLE_USER;

    private Date created;

    private String createdBy;

    private Date lastModified;

    private String lastModifiedBy;

    public UserModel() {
    }

    public UserModel(String username, String password) {
        this(username, password, username, Role.ROLE_USER);
    }

    public UserModel(String username, String password, String fullName) {
        this(username, password, fullName, Role.ROLE_USER);
    }

    public UserModel(String username, String password, String fullName, Role role) {
        super();
        this.username = username;
        this.password = password;
        this.fullName = fullName;
        this.role = role;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public Date getLastModified() {
        return lastModified;
    }

    public void setLastModified(Date lastModified) {
        this.lastModified = lastModified;
    }

    public String getLastModifiedBy() {
        return lastModifiedBy;
    }

    public void setLastModifiedBy(String lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("UserModel [id=").append(id).append(", username=").append(username).append("]");
        return builder.toString();
    }

}
